package com.moduls.interfaceFunction.core;


import com.alibaba.fastjson.JSON;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Locale;

public class Result {
    private int status;
    private String message="";
    private Object result="";

    public void setStatus(int resultStatus) {
        this.status = resultStatus;
    }

    public int getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    
    //逻辑异常直接执行完成，在异常处理的地方再处理
	public void setErrorMessage(String message) {
    	this.status = 0;
        this.message = message;
        throw new BusinessResultException(message, this);
    }


    public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	@Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}


